<template>
	<view class="page">
		<view class="head" @tap="$wanlshop.to('/pages/user/money/list')">
			<image src="/static/restaurant/user/record.png" mode="widthFix"></image>
			<text>账单记录</text>
		</view>
		
		<view class="info">
			<image src="/static/restaurant/user/money.png" mode="widthFix"></image>
			<text>我的余额</text>
			<text>￥{{userInfo && userInfo.money && userInfo.money.money1 || '0.00'}}</text>
		</view>
		
		<view class="btn" @tap="$wanlshop.to('/pages/restaurant/user/money/recharge')">充值</view>
		
	</view>
</template>

<script>
	import {mapState} from 'vuex';
	export default {
		data() {
			return {
				userInfo:null,
			}
		},
		computed: {
			...mapState(['user','common'])
		},
		onShow() {
			this.getUserInfo()
		},
		methods: {
			async getUserInfo() {
				let res = await this.$api.getUserInfo();
				if (res.code == 1) {
					this.userInfo = res.data
				}
			},
		}
	}
</script>
<style lang="less">
	page {
		background-color: #fff;
	}
</style>
<style lang="less" scoped>

.page {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	.head {
		padding: 10rpx 30rpx 0 30rpx;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		margin-bottom: 182rpx;
		image {
			width: 40rpx;
			height: 40rpx;
			margin-right: 10rpx;
		}
		text {
			color: #FA802A;
			font-weight: 500;
		}
	}
	.info {
		display: flex;
		flex-direction: column;
		align-items: center;
		image {
			width: 110rpx;
			height: 110rpx;
			margin-bottom: 18rpx;
		}
		text {
			&:nth-child(2) {
				color: #333333;
				font-size: 28rpx;
			}
			&:nth-child(3) {
				color: #333333;
				font-size: 98rpx;
			}
		}
	}
	
	.btn {
		width: 350rpx;
		line-height: 92rpx;
		text-align: center;
		height: 92rpx;
		background: #FA802A;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		color: #fff;
		font-size: 36rpx;
		margin: 0 auto;
		margin-top: 512rpx;
	}
}
</style>
